<h1><?=$player->getsfGuardUser()->getUsername()?></h1>


<table>
	<tr><th>rank</th><td><?php echo $player->getRank() ?></td></tr>
	<tr><th>points</th><td><?php echo $player->getPoints() ?></td></tr>
	<tr><th>victory</th><td><?php echo $player->getNbWin() ?></td></tr>
	<tr><th>defeat</th><td><?php echo $player->getNbLoss() ?></td></tr>
	<tr><th>draw</th><td><?php echo $player->getNbDraw() ?></td></tr>
	<tr><th>total</th><td><?php echo $player->getNbChallenge() ?></td></tr>
	<tr><th>ratio</th><td><?php echo $player->getNbChallenge() > 0 ? round(($player->getNbWin() / $player->getNbChallenge()) * 100)."%" : 'n/a' ?></td></tr>
</table>

<? if (count($unvalidated) > 0) { ?>
	<h2><?php echo image_tag('/web/images/error.png') ?>&nbsp;Unvalidated Challenges</h2>
	<?php include_partial('challenge/unvalidatedList', array('challenges' => $unvalidated)) ?>
<? } ?>

<h2>Last Challenges</h2>

<?php include_partial('challenge/list', array('challenges' => $challenges, 'player' => $player)) ?>
